/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --background-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
}

.logo {
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* 英雄区域 */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #eab308;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* 代码窗口 */
.code-window {
    background: #1a1b26;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.window-header {
    background: #2a2b36;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red { background: #ff5f56; }
.control.yellow { background: #ffbd2e; }
.control.green { background: #27ca3f; }

.window-title {
    color: #a9b1d6;
    font-size: 0.875rem;
}

.code-content {
    padding: 1.5rem;
}

.code-content pre {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-content code {
    color: #c0caf5;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* 特性区域 */
.features {
    padding: 4rem 0;
    background: #f8fafc;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--secondary-color);
}

/* 演示区域 */
.demo {
    padding: 4rem 0;
    background: white;
}

.demo-content {
    max-width: 800px;
    margin: 0 auto;
}

.demo-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.demo-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.demo-btn:hover,
.demo-btn.active {
    background: var(--primary-color);
    color: white;
}

.demo-result {
    background: #1a1b26;
    border-radius: 0.75rem;
    overflow: hidden;
}

.result-header {
    background: #2a2b36;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h4 {
    color: #a9b1d6;
    margin: 0;
}

.copy-btn {
    background: none;
    border: none;
    color: #a9b1d6;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.result-content {
    padding: 1.5rem;
}

.result-content pre {
    margin: 0;
    color: #c0caf5;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 文档区域 */
.documentation {
    padding: 4rem 0;
    background: #f8fafc;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.doc-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.doc-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.doc-card p {
    color: var(--secondary-color);
}

/* 社区区域 */
.community {
    padding: 4rem 0;
    background: white;
    text-align: center;
}

.community-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
}

/* 页脚 */
.footer {
    padding: 2rem 0;
    background: #1f2937;
    color: white;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .features-grid,
    .docs-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误状态 */
.success {
    color: var(--success-color);
}

.error {
    color: var(--error-color);
}